<template>
	<view class="content">
		<view class="wrap">
			<view class="gz dis-flex flex-x-between flex-y-center" @click="toJump('/pages/my/basicInfo')">
				<view class="txts flex-box">基本资料</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center" @click="toJump('/pages/my/accountSecurity')">
				<view class="txts flex-box">账号与安全</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center">
				<view class="txts flex-box">隐藏简介和内容</view>
				<u-switch @change="change" v-model="value" size="22" activeColor="#252525"></u-switch>
			</view>
		</view>

		<view class="wrap">
			<view class="gz dis-flex flex-x-between flex-y-center">
				<view class="txts flex-box">在线客服</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center" @click="my()">
				<view class="txts flex-box">关于我们</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center" @click="onUserAgree('user')">
				<view class="txts flex-box">用户协议</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>

			<view class="gz dis-flex flex-x-between flex-y-center" @click="onUserAgree('privacy')">
				<view class="txts flex-box">隐私协议</view>
				<u-icon name="arrow-right" color="#252525" size="20"></u-icon>
			</view>
		</view>

		<view class="wrap">
			<view class="gz">
				<view class="txts tac quit" @click="onOut">退出登录</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: uni.getStorageSync("num") == 1 ? true : false,
			}
		},

		craeted() {

			// this.value = uni.getStorageSync("value")	
		},
		methods: {
			// 显示隐藏简介
			change() {
				console.log(this.value)
				if (this.value) {
					uni.setStorageSync("num", 1)
				} else {
					uni.setStorageSync("num", 0)
				}
			},
			toJump(url) {
				if (!url) return
				uni.navigateTo({
					url
				});
			},

			/**
			 * 用户协议 隐私政策
			 */
			onUserAgree(type) {
				uni.navigateTo({
					url: "/pages/login/agreement?type=" + type
				})
			},
			/**
			 * 退出登录
			 */
			onOut() {
				uni.removeStorageSync("token")
				uni.reLaunch({
					url: "/pages/login/login"
				})
			},
			my() {
				uni.navigateTo({
					url: "/pages/login/agreement?type=my"
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f6f6f6;
	}
</style>

<style lang="scss" scoped>
	.content {
		padding: 0rpx 30rpx;

		.wrap {
			background: #FFFFFF;
			border-radius: 30rpx;

			.gz {
				padding: 30rpx;
				margin-top: 25rpx;

				.txts {
					font-weight: bold;
					font-size: 30rpx;
					color: $uni-text-color;
				}

				.quit {
					color: $uni-text-color-placeholder;
				}




			}
		}
	}
</style>